package com.qianfeng.openplatform.webmaster.controller;

import com.qianfeng.openplatform.webmaster.entry.LayuiDataTableSource;
import com.qianfeng.openplatform.webmaster.entry.OpenApiMaster;
import com.qianfeng.openplatform.webmaster.pojo.AppInfo;
import com.qianfeng.openplatform.webmaster.service.AppInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 江江
 * @Date 2020/7/23 9:14
 */
@RestController
@RequestMapping("sys/app_info")
public class ApiInfoController {

    @Autowired
    private AppInfoService infoService;

    @RequestMapping("/table")
    public LayuiDataTableSource apiInfoTable(@RequestParam(defaultValue = "1") Integer page,
                                             @RequestParam(defaultValue = "10") Integer limit,
                                             String corpName){
        return infoService.getApiInfoMgsToPage(page,limit,corpName);
    }

    @RequestMapping("/add")
    public OpenApiMaster addApp(AppInfo appInfo){
        System.out.println(appInfo.toString());
        return infoService.addAppinfo(appInfo);
    }
    @RequestMapping("/update")
    public OpenApiMaster update(AppInfo appInfo){
        System.out.println(appInfo.toString());
        return infoService.updateAppinfo(appInfo);
    }



}
















